﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.WCS.Domain.DomainRepository;
using Zocono.WCS.Domain.EntityInfo;
using Zocono.WCS.Domain.PlcPointDomain;
using Zocono.WCS.Infrastructure.ApllicationDto;
using Zocono.WCS.Infrastructure.ApllicationDto.DtoWcsManage;
using Zocono.WCS.Infrastructure.ApllicationDto.WCSTaskDto;

namespace Zocono.WCS.Application.AppConfigureManage
{
    public class PlcPointInfoApp
    {

        private readonly IPlcPointInfoService _IPlcPointInfoService;

        public PlcPointInfoApp(IPlcPointInfoService plcPointInfoService)
        {
            _IPlcPointInfoService = plcPointInfoService;
        }

        public async Task<bool> InsertPlcPointInfoAsync(PlcPointInfoDto plcPointInfo)
        {
            var res = await _IPlcPointInfoService.InsertPlcPointInfoAsync(plcPointInfo);
            return res;
        }

        //public async Task<List<PlcPointInfoDto>> GetPlcPointInfoAsync(PlcPointInfoDto plcPointInfo)
        //{
        //    PlcPointInfo plcPoint = new PlcPointInfo();
        //    _IMapper.Map(plcPointInfo, plcPoint);
        //    var resPlcPoint = await _IPlcPointInfoService.GetPlcPointInfoAsync(plcPoint);
        //    List<PlcPointInfoDto> plcPoints = new List<PlcPointInfoDto>();
        //    _IMapper.Map(resPlcPoint, plcPoints);
        //    return plcPoints;
        //}


        public async Task<PageDto<PlcPointInfoDto>> GetPagedPlcPointInfoAsync(QueryPlcPointDto queryPlcPointDto)
        {
            return await _IPlcPointInfoService.GetPagedPlcPointInfoAsync(queryPlcPointDto);
        }

        public async Task<bool> UpdatePlcPointInfoAsync(PlcPointInfoDto plcPointInfoDto)
        {
            return await _IPlcPointInfoService.UpdatePlcPointInfoAsync(plcPointInfoDto);
        }


        public async Task<PlcPointInfoDto> GetPlcPointInfoByIdAsync(long id)
        {
            return await _IPlcPointInfoService.GetPlcPointInfoByIdAsync(id);
        }


        public async Task<bool> DeletePlcPointInfoByIdAsync(long id)
        {
            return await _IPlcPointInfoService.DeletePlcPointInfoByIdAsync(id);
        }
    }
}
